package com.hjl.spring6.allConfig;

import com.hjl.spring6.resource.controller.UserController;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author ServivE
 * @version 0.1
 * @className TestUserController
 * @description
 * @date 2024/8/6 19:34
 * @since jdk11
 */
public class TestUserControllerAnno {
    @Test
    public void testUserController() {
        //加载配置类
        ApplicationContext ac = new AnnotationConfigApplicationContext(SpringConfig.class);
        UserController userController = ac.getBean("myUserContoller", UserController.class);
        userController.add();
    }
}
